<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>  
<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>  
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>文章编辑页</title>
<style type="text/css">
<!--
body,html{height:100%;}
body{background-color: #DFECEC;}
*{margin:0;padding:0;list-style:none;}
.div_box{border:0px solid #c1dcee;width:100%;height:98%;}
.table{border-collapse:collapse;border:none;height:auto !important;}
.table tr{height:auto !important;}
.td{color:#6F6F6F;font-weight: bold;font-size:15px;height:auto !important;min-height:50px;}
.td input{margin:5px;}
.td_right{text-align:right;}

.div_li_style{height:20px;width:100px;float:left;border:1px solid #ccc;margin-left:15px;font-size:13px;verticle-align:middle;min-height:20px;text-align:center;background-color: #EEEEEE;cursor: pointer;}
.div_li_style_on{height:20px;width:100px;float:left;border:1px solid #ccc;margin-left:15px;font-size:13px;verticle-align:middle;min-height:20px;text-align:center;cursor: pointer;background-color: #ffffff;border-bottom-color: #ffffff;}

.div_box .div_center{overflow: auto;overflow-x:hidden;}

.tools{margin: 5px; font-style: normal; font-size: 14px; height:25px;}
.tools{text-decoration: none;height: 24px;margin: 0 5px 0 0;background: url('${rc.contextPath}/images/btnout_bg_left.gif') no-repeat left center;float: left;_display: inline;-moz-user-select:none;}
.tools img {margin: 2px 0px 4px 4px;_display: inline;float: left; border: 0px;}
.tools b {cursor:pointer;	white-space: nowrap;color: #666;font-weight: normal;height: 24px;padding:0 3px 0 3px;line-height: 24px;background: url('${rc.contextPath}/images/btnout_bg_right.gif') no-repeat right center;display:inline-block;+zoom: 1;+display: inline;}
.tools:hover {text-decoration: none;background: url('${rc.contextPath}/images/btnover_bg_left.gif') no-repeat left center;}
.tools:hover b {color: #147;background: url('${rc.contextPath}/images/btnover_bg_right.gif') no-repeat right center;}

.filedset{border:1px #ccc solid;padding:5px}
.legend{font-size:14px;color:#575C64;}
.div_select{width:60%;overflow:hidden;border:1px #8f979c solid;margin:5px;padding:3px;background-color:#ffffff;}
.div_option{width:100%;height:20px;font-size:14px;color:#4F545B;border:none;background-color:#ffffff;}

.input_text{width:70%;font-size:16px;background-color:#ffffff;padding:3px;}
.input_border{border:1px #B3B3B3 solid;}
.input_onblur{border:2px #FFB444 solid;}

ul li{ vertical-align: middle; line-height: 20px;}
.ul_tree li{width:98%;min-width:175px;dispaly:inline;white-space:nowrap;font-size:15px;	font-family:'宋体';height:25px;cursor:pointer;}
.ul_tree li img{vertical-align: middle;}
.on_li{font-size:13px;font-family:'宋体';vertical-align:middle;	line-height:30px;height:30px;cursor:pointer;font-weight: bold;color:red;font-style: italic;}
.ul_tree_node li{width:auto !important;min-width:175px;display:-moz-inline-box;dispaly:inline-block; white-space:nowrap; font-size:15px;height:20px;cursor:pointer;}
.ul_tree_node li img{vertical-align: middle;margin-top:0px;}


.a_font{background-image: url('${rc.contextPath}/js/themes/default/default.png');background-repeat: no-repeat;width:25px;height:16px;border:1px solid #ccc;cursor:pointer;}
.a_font:hover{border:1px solid #80BDE6}
.a_ico_forecolor{background-position:0px -384px;}

.page_control{ padding:10px 5px;width:100%;height:auto !important;height:10px;}
.page_control a{ padding:0 5px; text-decoration:none;margin-right:5px;background-color:#CCC;color:#4164F1;}
.page_control a:hover{ text-decoration:none;margin-right:5px;background-color:#add2da;color:#fff;}
.page_control .on{ text-decoration:none; background-color: #136DA9;color:#fff;}
.f_l{ float:left; font-size:15px; color:#176193}
.f_r{ float:right;font-size:15px; color:#176193;}

.div_temp_option{padding:2px;color:#113044;width:100%;height:20px;font-size:15px;cursor:pointer;overflow: hidden;white-space: nowrap; text-overflow: ellipsis;display:inline-block;}
.div_temp_option:hover{background-color: #338FCC;color:#ffffff;}

/*自定义添加*/
.ke-icon-imgupload { background-image: url(${rc.contextPath}/js/themes/default/default.png); background-position: 0px -1232px; width: 16px; height: 16px;}
.ke-icon-paging { background-image: url(${rc.contextPath}/js/themes/default/default.png);  background-position: 0px -592px;  width: 16px; height: 16px;}

.site_result{display: inline-block;width: 100%;height:28px;font-size:12px;font-weight:bold; vertical-align:middle;line-height:28px; border:0px; overflow: hidden;white-space: nowrap; text-overflow: ellipsis; cursor:pointer;}
.site_result:hover{background: #ccc;}
.div_hint{border:1px solid #87876A;width:60%;height:auto !important;min-height:20px;margin:0 0 5px 5px;padding:5px;font-size:13px;color:#666666;font-weight: normal; background: #EEE8E8;}
.spanBtn{background-image: url('/EMSP_CMS/js/themes/default/default.png');background-position: 0px -1232px; width: 16px; height: 16px;display:inline-block;cursor:pointer;}
#bannerImg{display:none;}
-->
</style>
<script type="text/javascript">

</script>
</head>
<body>
<input type="hidden" id="websiteinfoId" value="${websiteinfoId.id }" />
<input type="hidden" id="websiteinfotitle" value="${websiteinfoId.ftitle }" />
<%-- 添加 --%>
<c:if test="${articleEntity == null }">

<form id="addArticle_form" action="addArticle" method="post" style="height:100%" >
<table class="table" border="0" width="99%"  cellpadding="0" cellspacing="0">
	<tr>
			<td height="25px" colspan="2">
				<div class="div_box" style="width:100%;padding:5px;verticle-align:middle;line-height:25px;">
					<a href="javascript:void(0)" onclick="EditArticle.addArticle('${rc.contextPath}',1)"  class="tools" ><img  src="${rc.contextPath }/images/08.gif" /><b>保存</b></a>
					<c:if test="${usermenu.freadonly == 'c' || usermenu.freadonly == 'wc'}">
						<a href="javascript:void(0)" onclick="EditArticle.addArticle('${rc.contextPath}',2)"  class="tools" ><img  src="${rc.contextPath }/images/08.gif" /><b>保存并发布	</b></a>
					</c:if> 
					<a href="javascript:void(0)" onclick="addpreviewArticle()" class="tools" ><img  src="${rc.contextPath }/images/web.gif"/><b>预览</b></a>
					<a href="javascript:void(0)" onclick="closeWindow()"  class="tools" ><img  src="${rc.contextPath }/images/26.gif" width="18px" height="18px"/><b>关闭</b></a>
				</div>
			</td>
		</tr>
		<tr >
			<td colspan="2" height="100%"  valign="top">
			<div class="div_box div_center" style="width:100%;background-color: #B6BAC0;height:auto !important;padding-top:20px;padding-bottom: 20px;">
				<div style="margin-left:auto;margin-right:auto;background-color:#ffffff;width:90%;height:auto !important;padding-top:10px;">
					<table class="table" width="100%" border="0" >
						<tr>
							<td width="15%" height="50px" class="td td_right">文章类型：</td>
							<td class="td" valign="middle">
								<div id="articleType" class="div_select">
									<select id="fclassid" name="fclassid" class="div_option" >
									</select>
								</div>
							</td>
						</tr>
						<tr>
							<td  class="td td_right">文章分类：</td>
					 		<td class="td">	
								<div id="articleClass" class="div_select">
									<select id="ftypeid" name="ftypeid" class="div_option" onchange="resourceCk(this)" >
									</select>
								</div>
								<div><img src="${rc.contextPath }/images/darrowup.gif" style="margin-left:20px;"/></div>
								<div id="div_hint" class="div_hint"></div>
						</td>
						</tr>
							<tr style="height:35px;">
								<td width="15%" class="td td_right">标题：</td>
								<td class="td">
								   <input type="text" id="ftitle" name="ftitle" class="input_text input_border" onblur="this.className = 'input_text input_border'" onfocus="this.className = 'input_text input_onblur'" />
								   <span id="bannerImg"><img src="${rc.contextPath }/images/direct.gif" /><font size="2">选择</font><span title="选择图片" class="spanBtn" onclick="EditArticle.source(1,'图片库','ftitle')"></span></span>
								</td>
							</tr>
							<tr style="height:40px;">
								<td width="15%" class="td td_right">&nbsp;</td>
								<td class="td">
									<div style="width:800px;height:38px;">
									  <div style="width:100px;float:left;height:38px;text-align:center;verticle-align:middle;line-height:38px;"><input type="checkbox" id="ico_checkbox" onclick="icoShow(this)"/>显示图标</div>
									  <div id="ico_box" style="float:left;display:none;height:38px;width:650px;verticle-align:middle;line-height:38px;">
									  	 <input type="checkbox" name="ico" value='<img src="${rc.contextPath }/images/video.png" />'/><img title="视频" src="${rc.contextPath }/images/video.png" style="margin-top:6px;">&nbsp;
									  	 <input type="checkbox" name="ico" value="【视频】"/>【视频】&nbsp;
									  	 <input type="checkbox" name="ico" value='<img src="${rc.contextPath }/images/it.gif" />'/><img title="图文" src="${rc.contextPath }/images/it.gif" style="margin-top:4px;">&nbsp;
									  	 <input type="checkbox" name="ico" value="【图文】" />【图文】&nbsp;
									  	 <input type="checkbox" name="ico" value="时间"/>时间<input type="text" id="fsummary_text" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',realFullFmt:'%Date'})" class="Wdate"/>
									  	 <font color="#ccc" size="2">(不输入则默认显示添加时间)</font>
									  </div>
									</div>
								</td>	
							</tr>
							
							<tr>
								<td width="15%" class="td td_right">搜索关键字：</td>
								<td class="td"><input style="width:200px;height:16px;margin-top:5px;" type="text" id="fsearchtext" name="fsearchtext" maxlength="20"  class="input_text input_border" onblur="this.className = 'input_text input_border'" onfocus="this.className = 'input_text input_onblur'"/></td>
							</tr>
							<tr id="full_video">
								<td width="15%" class="td td_right" valign="top">内容：</td>
								<td class="td">
									<div id="kindediter_panner" style="margin-top:5px;"><textarea id="fcontent" ></textarea></div>
									<textarea id="_fcontent" name="fcontent" style="display:none;"></textarea>
									<input type="hidden" id="fresourceid" name="fresourceid" />
								</td>
							</tr>
						
						<tr id="img_show_tr" style="display:none;">
							<td class="td td_right">展示图片：</td>
							<td  height="100%" style="padding-top:5px;"  valign="middle">
							    <div class="div_box">
							    		<input type="text" id="prewfresourceurl" name="showJsonStr" readonly="readonly" class="input_text input_border" style="font-size:13px;width:150px;"/>
							    		<input type="button" onclick="EditArticle.source(1,'图片库','prew')" value="  浏   览    " /> 
							    		<input type="hidden" id="img_prew_id" name="fhits" />
							    		<br>
								<div id="img_prew_show_min" style="width:101px;height:101px;display:none;" onmouseover="document.getElementById('img_prew_show_child').style.display='';" onmouseout="document.getElementById('img_prew_show_child').style.display='none';">
									<img id="img_prew_show" src="" width="100px" height="100px" />
									<div id="img_prew_show_child" onmouseout="this.style.display='none';" style="display:none;width:99px;height:99px;filter:alpha(opacity=50,style=0); opacity:0.5;background:black;position: relative;margin-top:-99px;text-align:center;vertical-align: middle;line-height:99px;">
										<a href="javascript:void(0)" style="position: relative; color:#ffffff;" onclick="cancelIMG('img_prew_show_min','img_prew_id','prewfresourceurl')" title="撤销"><b>撤销</b></a>
									</div>
								</div>
								</div>
							</td>
						</tr>
					  
						<tr id="videobank" style="display:none;">
							<td class="td td_right">视频库：</td>	 
							<td height="100%" style="padding-top:5px;"  valign="middle">
								<div class="div_box"> 
							    		<img id="videoImg" src="" onerror="this.src = '${rc.contextPath }/images/20121221144824.png'" width="40px" height="50px" align="middle"/>
							    		<input type="text" id="videofresourceurl" readonly="readonly" class="input_text input_border" style="font-size:13px;width:150px;"/><input type="button" onclick="EditArticle.source(2,'视频库')" value="   浏  览     " /> 
							    		<input type="button" value="更改播放模式" onclick="changePlayType()"/>
								</div>
								
							 </td>  
						 </tr>
						 <tr id="voicebank" style="display:none;">	  
							 <td class="td td_right">音频库：</td>	
							 <td height="100%"  style="padding-top:5px;"  valign="middle">		
							    	<div class="div_box">
							    		<img  id="voiceImg" src="" onerror="this.src = '${rc.contextPath }/images/20121221144908.png'"  width="40px" height="50px" align="middle"/>
							    		<input type="text" id="voicefresourceurl" readonly="readonly" class="input_text input_border" style="font-size:13px;width:150px;"/><input type="button" onclick="EditArticle.source(3,'音频库')" value="浏览" /> 
							    	</div>
							 </td>
						 </tr>
						 <tr style="height:50px;">
						 	<td class="td td_right">设置广告：</td>	
						 	<td class="td" height="100%"  style="padding-top:5px;"  valign="middle">
						 		<input type="checkbox" id="a_poster0" value="0" name="a_poster" checked="checked" onclick="posterOption(this,'img_poster_show_min','posterfresourceurl','img_poster_id')"/>使用默认广告     
						 		<input type="checkbox" id="a_poster1" value="1" name="a_poster" onclick="posterOption(this,'poster_box_main','poster_src','poster_str')"/>关联广告
						 		<div id="poster_box" style="display:none;">
						 			<input type="text"   id="posterfresourceurl" readonly="readonly" class="input_text input_border" style="width:150px;" />
						 			<input type="hidden" id="img_poster_id" />
							    	<input type="button" onclick="EditArticle.source(1,'图片库','poster')" value=  "   浏    览    " />
							 		<div id="img_poster_show_min" style="width:101px;height:101px;margin-left:5px;display:none;" onmouseover="document.getElementById('img_poster_show_child').style.display='';" onmouseout="document.getElementById('img_poster_show_child').style.display='none';">
										<img id="img_poster_show" src="" width="100px" height="100px" />
										<div id="img_poster_show_child" onmouseout="this.style.display='none';" style="display:none;width:99px;height:99px;filter:alpha(opacity=50,style=0); opacity:0.5;background:black;position: relative;margin-top:-99px;text-align:center;vertical-align: middle;line-height:99px;">
											<a href="javascript:void(0)" style="position: relative; color:#ffffff;" onclick="cancelIMG('img_poster_show_min','posterfresourceurl','img_poster_id');" title="撤销"><b>撤销</b></a>
										</div>
									</div>
								</div>
						 	</td>		
						 </tr>
						 <tr>	 
						 	 <td class="td td_right">模板库：</td>	   
						 	 <td class="td" height="100%" style="padding-top:5px;"   valign="middle">	
							    		<input type="text" id="ftemplatename" readonly="readonly" class="input_text input_border" style="width:150px;" />
							    		<input type="button" onclick="templateDiv()" value=  "   浏    览    " />
							    		<input type="hidden" name="ftemplateid" id="ftemplateid" />
							</td>
						</tr>	
					</table>
				</div>
			</div>
		</td>
		</tr>
</table>
</form>
</c:if>
<%--修改 --%>
<c:if test="${articleEntity != null }">
<form id="updateArticle_form" action="updateArticle" method="post">
<input type="hidden" id="articleId" name="id" value="${articleEntity.id }" />
<input type="hidden" id="saveTrue" value="0"/>
<input type="hidden" id="tcolid" value="${tcolid }" />
<input type="hidden" id="updateType" value="${updateType }" />

<table class="table" border="0" width="99%" height="98%" cellpadding="0" cellspacing="0">
	<tr>
		<td colspan="2" height="25px">
			<div class="div_box" style="width:99%;padding:5px;verticle-align:middle;line-height:25px;">
				<a href="javascript:void(0)" onclick="updateSave(1)"  class="tools" ><img  src="${rc.contextPath }/images/08.gif" /><b>保存</b></a>
				<%-- 未发布则显示直接发布按钮 --%>
				<c:if test="${usermenu.freadonly == 'c' || usermenu.freadonly == 'wc'}">
					<a href="javascript:void(0)" onclick="updateSave(2)"  class="tools" ><img  src="${rc.contextPath }/images/08.gif" /><b>保存并发布	</b></a>
				</c:if> 
				<a href="javascript:void(0)" onclick="previewArticle()" class="tools" ><img  src="${rc.contextPath }/images/web.gif"/><b>预览</b></a>
				<a href="javascript:void(0)" onclick="moveTcol('${rc.contextPath}')"  class="tools" ><img  src="${rc.contextPath }/images/move.png" width="20px" height="20px"/><b>关联到栏目</b></a>
				<%-- <a href="javascript:void(0)"  class="tools" ><img  src="${rc.contextPath }/images/export.gif"/><b>导入</b></a>
				<a href="javascript:void(0)"  class="tools" ><img  src="${rc.contextPath }/images/import.gif"/><b>导出</b></a>--%>
				<a href="javascript:void(0)" onclick="closeWindow()"  class="tools" ><img  src="${rc.contextPath }/images/26.gif" width="18px" height="18px"/><b>关闭</b></a>
			</div>
		</td>
	</tr>
	<tr>
		<td colspan="2" height="100%"  valign="top">
			<div class="div_box div_center" style="width:100%;background-color: #B6BAC0;height:auto !important;min-height:98%;padding-top:20px;padding-bottom: 20px;">
				<div style="margin-left:auto;margin-right:auto;background-color:#ffffff;width:90%;height:auto !important;min-height:100%;padding-top:10px;">
					<table class="table" width="100%" border="0">
						<tr>
							<td width="15%" class="td td_right">文章类型：</td>
							<td class="td" valign="middle">
								<div id="articleType" class="div_select">
									<input type="hidden" id="update_fclassid" value="${articleEntity.fclassid }" />
									<select id="fclassid" name="fclassid" class="div_option" >
									</select>
								</div>
							</td>
						</tr>
						<tr>
							<td  class="td td_right">文章分类：</td>
					 		<td class="td">	
								<div id="articleClass" class="div_select">
									<input type="hidden" id="update_ftypeid" value="${articleEntity.ftypeid }" />
									<select id="ftypeid" name="ftypeid" class="div_option" onchange="resourceCk(this)" >
										</select>
								</div>
								<div><img src="${rc.contextPath }/images/darrowup.gif" style="margin-left:20px;"/></div>
								<div id="div_hint" class="div_hint"></div>
						</td>
						</tr>					
						
						<tr style="height:35px;">
							<td width="15%" class="td td_right">标题：</td>
							<td class="td"><input type="text" id="ftitle" name="ftitle" value='${articleEntity.ftitle}' class="input_text input_border" onblur="this.className = 'input_text input_border'" onfocus="this.className = 'input_text input_onblur'" />
							<span id="bannerImg"><img src="${rc.contextPath }/images/direct.gif" /><font size="2">选择</font><span title="选择图片" class="spanBtn" onclick="EditArticle.source(1,'图片库','ftitle')"></span></span>
							</td>
						</tr>
						<tr style="height:40px;">
								<td width="15%" class="td td_right">&nbsp;</td>
								<td class="td">
									<div style="width:800px;height:38px;">
									  <div style="width:100px;float:left;height:38px;text-align:center;verticle-align:middle;line-height:38px;"><input type="checkbox" id="ico_checkbox" onclick="icoShow(this)" <c:if test="${articleEntity.fsummary != '' && articleEntity.fsummary != null}">checked="checked"</c:if> />显示图标</div>
									  <div id="ico_box" style="float:left;height:38px;width:650px;verticle-align:middle;line-height:38px;<c:if test="${articleEntity.fsummary == ''}">display:none;</c:if>">
<script type="text/javascript">
 window.onload =function selectIco(){
		var fusmmary = '${articleEntity.fsummary}';
		if(fusmmary != ''){
			var icoArr = fusmmary.split(";");
			for(var f=0;f<icoArr.length;f++){
				if(icoArr[f] == '<img src="${rc.contextPath}/images/video.png" />'){
					$("#ico1").attr('checked',true);
				}
				if(icoArr[f] == '<img src="${rc.contextPath}/images/it.gif" />'){
					$("#ico3").attr('checked',true);
				}
				if(icoArr[f] == '【视频】'){
					$("#ico2").attr('checked',true);
				}
				if(icoArr[f] == '【图文】'){
					$("#ico4").attr('checked',true);
				}
				if(icoArr[f] != '' && icoArr[f] != '<img src="${rc.contextPath}/images/video.png" />'
					&& icoArr[f] != '<img src="${rc.contextPath}/images/it.gif" />'
						&& icoArr[f] != '【视频】' && icoArr[f] != '【图文】'){
					$("#ico5").attr('checked',true);
					$("#fsummary_text").val(icoArr[f]);
				}
			}
		}
	}								 
</script>
									  		<input type="checkbox" id="ico1" name="ico" value='<img src="${rc.contextPath}/images/video.png" />'/><img title="视频" src="${rc.contextPath }/images/video.png" style="margin-top:6px;">&nbsp;
									  	 	<input type="checkbox" id="ico2" name="ico" value="【视频】"/>【视频】&nbsp;
									  		<input type="checkbox" id="ico3" name="ico" value='<img src="${rc.contextPath}/images/it.gif" />'/><img title="图文" src="${rc.contextPath }/images/it.gif" style="margin-top:4px;">&nbsp;
									  		<input type="checkbox" id="ico4" name="ico" value="【图文】" />【图文】&nbsp;
									  		<input type="checkbox" id="ico5" name="ico" value="时间"/>时间<input type="text" id="fsummary_text" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',realFullFmt:'%Date'})" class="Wdate"/>
									  	 	<font color="#ccc" size="2">(不输入则默认显示添加时间)</font>
									  	
									  </div>
									</div>
								</td>
						</tr> 
						<tr>
							<td width="15%" class="td td_right">搜索关键字：</td>
							<td class="td"><input style="width:200px;height:16px;" type="text"  id="fsearchtext" name="fsearchtext" value="${articleEntity.fsearchtext }" maxlength="20"  class="input_text input_border" onblur="this.className = 'input_text input_border'" onfocus="this.className = 'input_text input_onblur'"/></td>
						</tr>
						<tr  id="full_video">
							<td width="15%" class="td td_right" valign="top">内容：</td>
							<td class="td">
								<div id="kindediter_panner"><textarea id="fcontent" >${articleEntity.fcontent }</textarea></div>
								<textarea id="_fcontent" name="fcontent" style="display:none;">${articleEntity.fcontent }</textarea>
								<input type="hidden" id="fresourceid" name="fresourceid" value="${articleEntity.fresourceid }"/>
							</td>
						</tr>
						
						<tr id="img_show_tr" <c:if test="${empty showResource }">style="display:none;"</c:if><c:if test="${!(empty showResource)  }">style="display:'';"</c:if> >
							<td class="td td_right">展示图片：</td>
							<td  height="100%" style="padding-top:5px;"  valign="middle">
							    <div class="div_box">
							    		<input type="text" id="prewfresourceurl" name="showJsonStr" readonly="readonly" class="input_text input_border" value="${showResource}" style="font-size:13px;width:150px;"/><input type="button" onclick="EditArticle.source(1,'图片库','prew')" value="  浏  览  " /> 
							    		<input type="hidden" id="img_prew_id" name="fhits" value="${articleEntity.fhits}" />
							    		<br>
								<div id="img_prew_show_min" style="width:101px;height:101px; <c:if test="${empty showResource }"> display:none;</c:if>  <c:if test="${!(empty showResource)  }">display:'';</c:if>" onmouseover="document.getElementById('img_prew_show_child').style.display='';" onmouseout="document.getElementById('img_prew_show_child').style.display='none';">
									<img id="img_prew_show" src="${showResource}" width="100px" height="100px" />
									<div id="img_prew_show_child" onmouseout="this.style.display='none';" style="display:none;width:99px;height:99px;filter:alpha(opacity=50,style=0); opacity:0.5;background:black;position: relative;margin-top:-99px;text-align:center;vertical-align: middle;line-height:99px;">
										<a href="javascript:void(0)" style="position: relative; color:#ffffff;" onclick="cancelIMG('img_prew_show_min','img_prew_id','prewfresourceurl')" title="撤销"><b>撤销</b></a>
									</div>
								</div>
								</div>
							</td>
						</tr>
						
						<c:if test="${ (resourceEntity != null && resourceEntity.fresourcetype == '视频')}">
						    <tr id="videobank" style="display:none;" >
								<td class="td td_right">视频库：</td>	 
								<td height="100%" style="padding-top:5px;"  valign="middle">
									<div class="div_box"> 
								    		<img id="videoImg" src="${resourceEntity.fbillurl }" onerror="this.src = '${rc.contextPath }/images/20121221144824.png'" width="40px" height="50px" align="middle"/>
								    		<input type="text" id="videofresourceurl" readonly="readonly" value="${resourceEntity.fname }" class="input_text input_border" style="font-size:13px;width:200px;"/><input type="button" onclick="EditArticle.source(2,'视频库')" value="   浏    览     " /> 
											<input type="button" value="更改播放模式" onclick="changePlayType()"/>
									</div>
								 </td>  
							 </tr>
						 </c:if>
						<c:if test="${ resourceEntity == null }">
						<tr id="videobank"  style="display:none;"  >
								<td class="td td_right">视频库：</td>	 
								<td height="100%" style="padding-top:5px;"  valign="middle">
									<div class="div_box"> 
								    		<img id="videoImg" src="" onerror="this.src = '${rc.contextPath }/images/20121221144824.png'" width="40px" height="50px" align="middle"/>
								    		<input type="text" id="videofresourceurl" readonly="readonly" class="input_text input_border" style="font-size:13px;width:200px;"/><input type="button" onclick="EditArticle.source(2,'视频库')" value="   浏     览     " />
								    </div>
								 </td>  
						 </tr> 
						 </c:if>
						<c:if test="${ ( resourceEntity != null && resourceEntity.fresourcetype == '音频') }">
						 <tr id="voicebank"   style="display:none;"  >	  
							 <td class="td td_right">音频库：</td>	
							 <td height="100%"  style="padding-top:5px;"  valign="middle">		
							    	<div class="div_box">
							    		<img  id="voiceImg" src="${rc.contextPath }/images/20121221144908.png" onerror="this.src = '${rc.contextPath }/images/20121221144908.png'"  width="40px" height="50px" align="middle"/>
							    		<input type="text" id="voicefresourceurl" readonly="readonly" value="${resourceEntity.fname }" class="input_text input_border" style="font-size:13px;width:200px;"/><input type="button" onclick="EditArticle.source(3,'音频库')" value="浏览" /> 
							    	</div>
							 </td>
						 </tr>
						</c:if>
						<c:if test="${ resourceEntity == null }">
						<tr id="voicebank"   style="display:none;" >	  
							 <td class="td td_right">音频库：</td>	
							 <td height="100%"  style="padding-top:5px;"  valign="middle">		
							    	<div class="div_box">
							    		<img  id="voiceImg" src="" onerror="this.src = '${rc.contextPath }/images/20121221144908.png'"  width="40px" height="50px" align="middle"/>
							    		<input type="text" id="voicefresourceurl" readonly="readonly"   class="input_text input_border" style="font-size:13px;width:200px;"/><input type="button" onclick="EditArticle.source(3,'音频库')" value="浏览" /> 
							    	</div>
							 </td>
						 </tr> 
						</c:if>
						 <tr style="height:50px;">
						 	<td class="td td_right">设置广告：</td>	
						 	<td class="td" height="100%"  style="padding-top:5px;"  valign="middle">
						 		<input type="checkbox" id="a_poster0" value="0" name="a_poster" <c:if test="${empty posterResource}"> checked="checked"</c:if> onclick="posterOption(this,'img_poster_show_min','posterfresourceurl','img_poster_id')"/>使用默认广告     
						 		<input type="checkbox" id="a_poster1" value="1" name="a_poster" <c:if test="${!empty posterResource}"> checked="checked"</c:if> onclick="posterOption(this,'poster_box_main','poster_src','poster_str')"/>关联广告
						 		<div id="poster_box" 
						 			<c:if test="${!empty posterResource}"> style="display:'';" </c:if> 
						 			<c:if test="${empty posterResource}"> style="display:none;" </c:if> 
						 		>
						 			<input type="text"   id="posterfresourceurl" value="${posterResource}" readonly="readonly" class="input_text input_border" style="width:150px;" />
						 			<input type="hidden" id="img_poster_id" />
							    	<input type="button" onclick="EditArticle.source(1,'图片库','poster')" value=  "   浏    览    " />
							 		<div id="img_poster_show_min" style="width:101px;height:101px;margin-left:5px;
							 			<c:if test="${!empty posterResource}"> display:'' </c:if>
							 			<c:if test="${empty posterResource}"> display:'none' </c:if>
							 		" onmouseover="document.getElementById('img_poster_show_child').style.display='';" onmouseout="document.getElementById('img_poster_show_child').style.display='none';">
										<img id="img_poster_show" src="${posterResource}" width="100px" height="100px" />
										<div id="img_poster_show_child" onmouseout="this.style.display='none';" style="display:none;width:99px;height:99px;filter:alpha(opacity=50,style=0); opacity:0.5;background:black;position: relative;margin-top:-99px;text-align:center;vertical-align: middle;line-height:99px;">
											<a href="javascript:void(0)" style="position: relative; color:#ffffff;" onclick="cancelIMG('img_poster_show_min','posterfresourceurl','img_poster_id');" title="撤销"><b>撤销</b></a>
										</div>
									</div>
								</div>
						 	</td>		
						 </tr> 
						 <tr>	 
						 	 <td class="td td_right">模板库：</td>	   
						 	 <td height="100%" style="padding-top:5px;"   valign="middle">	
							    		<c:if test="${templateEntity != null }">
							    			<input type="text" id="ftemplatename" readonly="readonly" value="${templateEntity.fname }" class="input_text input_border" style="width:150px;" />
							    			<input type="button" onclick="templateDiv()" value="浏览" />
							    			<input type="hidden" name="ftemplateid" id="ftemplateid" value="${templateEntity.id }" />
		    							</c:if>
							    		<c:if test="${templateEntity == null }">
							    			<input type="text" id="ftemplatename" readonly="readonly" class="input_text input_border" style="width:150px;" />
							    			<input type="button" onclick="templateDiv()" value="浏览" />
							    			<input type="hidden" name="ftemplateid" id="ftemplateid"   />
							    		</c:if>
							</td>
						</tr>	
					</table>
				</div>
			</div>
				<%--<div class="div_select" style="overflow:auto;overflow-x:hidden;">
					<c:forEach items="${tcolunmList }" var="tcol">
						<div id="div_li"><img src="${rc.contextPath }/images/tree/folder.gif" align="middle"/>${tcol.fcolumnname }</div>
					</c:forEach>
				</div> --%>
		</td>	
	</tr>
</table>
</form>
</c:if>
<%-- 模板弹出层 --%>
<div id="template_div" style="background-color:#ffffff;border:2px solid #6495E0;width:200px;height:300px;display:none;position: absolute;z-index:100;">
	<div style="height:285px;background-color:#ffffff;"><font size="2" color="green">双击选择</font><img src="${rc.contextPath }/images/ORB_Icons_by_023.png" title="关闭" onclick="closeTempDiv()" style="float:right;cursor:pointer;" />
		<div id="template_source" style="height:260px;width:98%;overflow:auto;overflow-x:hidden;"></div>
	</div>
</div>

<div  style="padding:5px;width:1;height:480px;display:none;">
	<form id="source_form" action="resouceList" method="post">
		<input type="hidden" id="start" name="start" value="0"/>
		<input type="hidden" id="limit" name="limit" value="9"/>
		<input type="hidden" id="type" name="type" />
	</form>
	<div id="source_div_foot">
		<div class="page_control">
				<span class="f_l" id="totalCount"></span>
				<span class="f_r" id ='pagePanel'></span>
		</div>
	</div>
</div>

<!-- web panner -->
<div id="_dPanel" style="width:160px;height:auto !important;min-height:50px;background: #ffffff;z-index: 811215;border:1px solid #ccc;position: absolute;">
</div>
<script type="text/javascript" src="${rc.contextPath }/js/jquery/jquery-1.8.2.js"></script>
<script type="text/javascript" src="${rc.contextPath }/js/jquery/jquery.form.js"></script>
<script type="text/javascript" src="${rc.contextPath }/js/jquery/jquery.blockUI.js" charset="utf-8"></script>
<script type="text/javascript" src="${rc.contextPath}/js/kindeditor-min.js" ></script>
<script type="text/javascript" src="${rc.contextPath}/js/zh_CN.js" ></script>
<script type="text/javascript" src="${rc.contextPath}/js/datepicker/WdatePicker.js"></script>
<script type="text/javascript" src="${rc.contextPath}/js/article/editArticle.js" ></script>
<script type="text/javascript" src="${rc.contextPath}/js/article/article.js" ></script>
<script type="text/javascript" src="${rc.contextPath}/js/article/article.plugins.js" ></script>
<script type="text/javascript" src="${rc.contextPath}/js/article/shint.js" ></script>
<script type="text/javascript" src="${rc.contextPath}/js/page.js" ></script>
<script type="text/javascript">
$(document).ready(function(){
	EditArticle.loadSource();
	loadWebsiteInfoSource();
	showHintText("图文");
});

function loadWebsiteInfoSource(){
	$.ajax({
		url:'websiteinfoSource',
		type:'post',
		dataType:'json',
		success:function(data){
			var sHtml = '';
			$.each(data,function(i,u){
				sHtml += '<span class="site_result" id="'+u.id+'">' +u.ftitle+ '</span>';
			});
			$("#_dPanel").html(sHtml);
			$("#_dPanel").hide();
		},
		error:function(msg){
			$.growlUI('网站数据加载出错');
		}
	});
	
}

function templateDiv(){
	var x = $("#ftemplatename").offset().left;
	var divH = $("#template_div").height();
	var y = $("#ftemplatename").offset().top;
	//alert(y + ">>" + divH);
	
	if(y > divH ){
		y = eval(y - divH - 4);
	}else{
		y = eval( y + 30 );
	}
			
	
	$("#template_div").animate({left:x+'px',top:y+'px'});
	$("#template_div").slideDown(200);
	$.ajax({
		url:'templateEntitySource',
		type:'post',
		dataType:'json',
		success:function(data){
			var html = '';
			$.each(data,function(i,u){
				html += '<div ondblclick="dblCkTemp('+u.id+')" title="' + u.fname + '" class="div_temp_option"><img src="${rc.contextPath}/images/iebg.png" width="25px" height="20px" align="middle"/><span id="fname'+u.id+'">'+u.fname+'</span></div>'
			});
			$("#template_source").html(html);
		},
		error:function(msg){
			$.growlUI('模板加载出错');
		}
	});
}
function closeTempDiv(){
	$("#template_div").slideUp(200);
}
function dblCkTemp(id){
	$("#ftemplateid").val(id);
	$("#ftemplatename").val($("#fname"+id).html());
	closeTempDiv();
}
function resourceCk(obj){
	$("#bannerImg").hide();
	$("#voicebank").hide();
	$("#videobank").hide();
	$("#_fcontent").hide();
	$("#tip_text").hide();
	$("#play_type").hide(); 
	$("#full_video").hide();
	$("#img_show_tr").hide();
	$("#kindediter_panner").hide();
	var text = $(obj).find(":selected").text();
	if( text == '图文+视频' || text == '文本+视频'){
		$("#full_video").show();
		$("#videobank").show();
		$("#img_show_tr").show();
		$("#kindediter_panner").show();
	}else if(text == "全屏视频" || text == '视频'){
		contentEditor.html('');
		$("#videobank").show();
		$("#play_type").show();
	}else if(text == "链接" || text == "图片"){
		if(text == "图片")
			$("#bannerImg").show();
		
		$("#full_video").show();
		contentEditor.html('');
		$("#_fcontent").show();
		$("#_fcontent").addClass('input_text');
		$("#_fcontent").after('<font id="tip_text" size="3" color="red">*输入有效的URL</font>');
	}else if(text == '音频' || text == '图文+音频' || text == '文本+音频'){
		$("#full_video").show();
		$("#voicebank").show();
		$("#kindediter_panner").show();
	}else{
		$("#full_video").show();
		$("#kindediter_panner").show();
	}
	//显示提示
	showHintText(text);
}
function previewArticle(){
	window.open('${rc.contextPath}/site/preview?id='+$("#articleId").val()+'&cid='+$("#tcolid").val()+"&tid="+$("#ftemplateid").val());
}
function addpreviewArticle(){
	var temid = $("#ftemplateid").val();
	if(temid != ''){
		$("#addArticle_form").attr('action','${rc.contextPath}/site/preview?article');
		$("#addArticle_form").attr('target','_blank');
		$("#_fcontent").val(contentEditor.html());
		$("#addArticle_form").submit();
	}else{
		$.growlUI('预览请选中模板');
	}
}
function icoShow(obj){
	if(obj.checked){
		$("#ico_box").show(400);
	}else{
		$("#ico_box").hide();
	}
}

//撤销
function cancelIMG(m,r,v){
	$("#" + m).hide();
	$("#" + r).val('');
	$("#" + v).val('');
}
//
function posterOption(o,m,r,s){
	o.checked = 'checked';
	if(o.value == 0){
		cancelIMG(m,r,s);
		$("#a_poster1").attr('checked',false);
		$("#poster_box").hide(50);
	}else{
		$("#a_poster0").attr('checked',false);
		$("#poster_box").show(50);
	}
}
</script>
</body>
</html>